#include <iostream>
#include <cstdlib>
#include "monitor.h"

using namespace std;

int main(int argc, char**argv){	
	monitor* testMon = new monitor();
	int disk_track;
	int disk_work;
	int track_res;
	int work_res;
	
	request * tempReq;
	for (int i = 0; i < 10; i++) {
		disk_track = i+ rand() % 16;
		disk_work = i+ rand() % 100;
		tempReq = new request(disk_track, disk_work);
		cout << "New request #: " << i+1 << " with track: " <<  disk_track << " and work: " << disk_work << "." << endl;
		cout << "addReq for request: " << i << " is " << testMon->addRequest(tempReq) << endl;
		cout << endl;
	}
	
	cout << "Requests are scheduled: " << testMon->scheduleRequests() << endl;
	cout << endl;
	
	request* result;
	for (int k = 0; k < 10; k++) {
		result = testMon->removeRequest();
		track_res = result->getTrackNum();
		work_res = result->getWorkSize();
		cout << "Got job #: " << 10-k << ", on track " << track_res << " and with work " << work_res << "." << endl;
		cout << endl;
	}
	delete tempReq;
	delete result;	
	delete testMon;
	return 0;
}
